import java.util.*; 

public class StringProcessing2 {
	

	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		System.out.println("请输入：");
		String str1 = sc.nextLine();
		
		
		 String[] sourceStrArray=str1.split("\\s+");
		 Map<String,Integer> map = new HashMap<>();  
		 int num=0;
	     for (int i = 0; i < sourceStrArray.length; i++) {  
	         if (!(map.containsKey(sourceStrArray[i]))){
	        	 map.put(sourceStrArray[i],1);
	        	 num++;
	        } }
	      System.out.println(num);
		// TODO Auto-generated method stub

	}
}